package com.enation.app.javashop.core.payment.plugin.alipay;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayRequest;
import com.alipay.api.AlipayResponse;
import com.alipay.api.internal.util.*;
import com.alipay.api.internal.util.json.JSONWriter;
import com.enation.app.javashop.core.payment.model.vo.Form;
import com.enation.app.javashop.core.payment.model.vo.FormItem;
import com.enation.app.javashop.core.payment.model.vo.PayBill;
import com.enation.app.javashop.core.payment.service.AbstractPaymentPlugin;
import com.enation.app.javashop.framework.test.BaseTest;

import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;


/**
 * @author fk
 * @version v2.0
 * @Description: 支付宝配置相关
 * @date 2018/4/12 10:25
 * @since v7.0.0
 */
public class AlipayPluginConfig extends AbstractPaymentPlugin {

    public final String siteName = "javashop商城";

    @Override
    protected String getPluginId() {

        return "alipayDirectPlugin";
    }

    /**
     * 设置参数
     */
    public void setConfig(PayBill bill) {
        Map<String, String> config = this.getConfig(bill.getClientType());
        //沙箱环境
//		AlipayConfig.gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
        AlipayConfig.appId = config.get("app_id");
        AlipayConfig.merchantPrivateKey = config.get("merchant_private_key");
        AlipayConfig.alipayPublicKey = config.get("alipay_public_key");
    }

}
